{config_load file=test.conf section="setup"}
{include file="header.tpl" title=Questions Name=Modify}

<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript">
{literal}
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
//		editor_selector : "mceEditor",
	//	editor_deselector : "mceNoEditor",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
	
		// Theme options
//		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : /*"cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,*/"image",/*cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",*/
//		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
//		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
	
		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",
	
		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",
	
		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
	function hideEditor(){
		tinyMCE.get('question').hide();
		for(var i = 0; i < 4; i++){
			tinyMCE.get('choice'+i).hide();
		}
		document.getElementById('question').style.display = "block";
		for(var i = 0; i < 4; i++){
			document.getElementById('choice'+i).style.display = "block";
		}
	}
	function showM_hide(){
		if(document.getElementById('showM_button').value == 'Show>>'){
			tinyMCE.get('question').show();
			document.getElementById('showM_button').value = '<<Hide';
		}
		else if(document.getElementById('showM_button').value == '<<Hide'){
			tinyMCE.get('question').hide();
			document.getElementById('showM_button').value = 'Show>>';
		}
	}
	function showA_hide(i){
		if(document.getElementById('showA_button'+i).value == 'Show>>'){
			tinyMCE.get('choice'+i).show();
			document.getElementById('showA_button'+i).value = '<<Hide';
		}
		else if(document.getElementById('showA_button'+i).value == '<<Hide'){
			tinyMCE.get('choice'+i).hide();
			document.getElementById('showA_button'+i).value = 'Show>>';
		}
	}	

{/literal}
</script>
<body onLoad="hideEditor()">
<PRE>
<form method="post" name="question_m" action="updating.php">
<table border="1">
	<tr>
		<td>Category:</td>
		<td><select name="category" id="category">
				{section name = j loop = $categories}
					{$categories[j]}
				{/section}
			</select>
		</td>
	</tr>
	<tr>
		<td>Complexity:</td>
		<td><select name="complexity" id="complexity" >
				<option {if $comp eq 1} selected="selected"{/if}>1</option>
				<option {if $comp eq 2} selected="selected"{/if}>2</option>
				<option {if $comp eq 3} selected="selected"{/if}>3</option>
				<option {if $comp eq 4} selected="selected"{/if}>4</option>
				<option {if $comp eq 5} selected="selected"{/if}>5</option>
			</select>
		</td>
	</tr>
	<tr>
		<td>Question ID:</td>
		<td>{$q_id}<input type="hidden" value="{$q_id}" name="question_id" /></td>
	</tr>
	<tr>
		<td>Question:</td>
		<td><textarea name="question" id="question">{$q_title}</textarea><input type="button" id="showM_button" value="Show>>" onClick="showM_hide()"/></td>
	</tr>
	{section name = i loop = $choices}
	<tr>
		<td><input type="radio" name="radio" id="radio" value='{$choices_order[i]-1}' {if $correct_value[i] eq 1}checked="checked"{/if}/></td>
		<td id="holdradio{$smarty.section.i.rownum-1}"><textarea name="choice[]" id="choice{$smarty.section.i.rownum-1}" >{$choices[i]}</textarea><input type="hidden" name="answers[]" value="{$choices_id[i]}" /><input type="button" id="showA_button{$smarty.section.i.rownum-1}" value="Show>>" onClick="showA_hide({$smarty.section.i.rownum-1})"/></td>
	</tr>
	{/section}
	<tr>
		<td>Updated date:</td>
		<td>{$q_udate}{$hidden}</td>
	</tr>
	<tr>
		<td>Created date:</td>
		<td>{$q_cdate}</td>
	</tr>
	<tr>
		<td colspan="2" align="right">
			<input type="submit" name="modify_question" id="modify_question" value="Modify"/>
		</td>
	</tr>
</table>
</form>
</PRE>
<a href="modify_question.php">back to Modify Question</a>

{include file="footer.tpl"}